package cn.tedu.fresheveryday.controller;

import cn.tedu.fresheveryday.pojo.entity.Banner;
import cn.tedu.fresheveryday.service.IBannerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@Api(tags = "轮播图模块")
@RequestMapping(path = "/banner", produces = "application/json;charset=utf-8")
public class BannerController {
    @Autowired
    private IBannerService service;

    /**
     * 查询全部轮播图
     *
     * @return List<Banner>
     */
    @GetMapping("/selectAll")
    @ApiOperation("查询全部轮播图")
    public List<Banner> selectAll() {
        log.trace("查询全部轮播图");
        List<Banner> banners = service.selectAll();
        log.trace("查询结果：{}", banners);
        return banners;
    }

}